<?php

header("content-type: text/html; charset=iso-8859-1;", true);

$dbHost = "127.0.0.1:3306";
$dbUser = "root";
$dbPass = "babilonia";
$dbData = "reservas";

$conn = mysql_connect($dbHost,$dbUser,$dbPass) or die(mysql_error());
mysql_select_db($dbData,$conn) or die(mysql_error());

mysql_query("SET NAMES 'utf8';");

session_start();

$id=$_POST["IDReserva"];
$quem=$_POST["QuemCancelou212"];
$quemPediu=$_POST["QuemPediuCancelamento212"];
$data=$_POST["cancelaDia212"];

$query="UPDATE tab_reserva_salas SET Cancelada=1, QuemCancelou='$quem', QuemPediuCancelamento='$quemPediu', DataCancelamento='$data' WHERE IDReserva='$id'";

if(!mysql_query($query, $conn)) {
	echo "{success: false}";
}

else {
    echo "{success: true}";
}

?>